﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
    /// <summary>
    /// 食堂人员
    /// </summary>
   public class EntityUser
    {
        /// <summary>
        /// Id
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid Id { get; set; } = Guid.NewGuid();

        /// <summary>
        /// 姓_氏
        /// </summary>
        [Required]
        [StringLength(50)]
        public String?  FirstName { get; set; }

        /// <summary>
        /// 姓_名
        /// </summary>
        [Required]
        [StringLength(50)]
        public String? LastNanme { get; set; }

        /// <summary>
        /// 姓名
        /// NotMapped:：不映射到数据库
        /// </summary>
        [NotMapped]
        public String? Name { get => this.FirstName + this.LastNanme; }

        /// <summary>
        /// 0:管理员 1:厨师 2：服务员
        /// </summary>
        [Required]
        public int  Type { get; set; }

        /// <summary>
        /// 支付薪资
        /// </summary>
        [Required]
        public float Pay { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Required]
        public bool Gender { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        [Required]
        public int Age { get; set; }

        /// <summary>
        /// 加入时间
        /// </summary>
        [Required]
        public DateTime AddTime { get; set; }

        /// <summary>
        /// 离职时间
        /// </summary>
        public DateTime? DimissionTime { get; set; }

        /// <summary>
        /// 休假时间
        /// </summary>
        public DateTime HolidayTime { get; set; }

    }
}
